<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
body, html {
	background-color: #f1f3f6;
}

a, input, button {
	outline: medium;
}

.login_page {
	width: 100%;
	float: left;
	clear: both;
	margin: 50px 0 0 0;
}

.login_logo {
	width: 199px;
	height: 94px;
	margin: 0 auto;
}

.login_cont {
	width: 320px;
	margin: 0 auto;
}

.login_ctitle {
	text-align: center;
	font-weight: 800;
	width: 320px;
	height: 60px;
	background: #841028;
	float: left;
	clear: both;
	font-size: 34px;
	color: #fff;
	line-height: 60px;
}

.login_input {
	width: 100%;
	background-color: #fff;
	float: left;
	clear: both;
}

.login_user {
	width: 303px;
	height: 62px;
	background: url(images/login_11.jpg) no-repeat;
	float: left;
	clear: both;
	margin: 20px 0 0 10px;
	display: inline;
}

.login_user input {
	width: 240px;
	line-height: 55px;
	background: none;
	height: 55px;
	float: right;
	border: 0px;
}

.login_pass {
	width: 303px;
	height: 62px;
	background: url(images/login_14.jpg) no-repeat;
	float: left;
	clear: both;
	margin: 20px 0 0 10px;
	display: inline;
}

.login_pass input {
	width: 240px;
	line-height: 55px;
	background: none;
	height: 55px;
	float: right;
	border: 0px;
}

.login_button {
	width: 100%;
	float: left;
	clear: both;
	padding: 0 0 20px 0;
}

.login_button01 {
	width: 150px;
	height: 52px;
	float: left;
	background: url(images/login_17.jpg) no-repeat;
	margin: 30px 0 0 10px;
	display: inline;
	border: 0px;
	cursor: pointer;
}

.login_button02 {
	width: 128px;
	height: 52px;
	float: right;
	background: url(images/login_19.jpg) no-repeat;
	margin: 30px 10px 0 0px;
	display: inline;
	border: 0px;
	cursor: pointer;
}

.tip_error {
	width: 100%;
	float: left;
	clear: both;
	margin: 10px 0 0 0;
}

.tip_error span {
	color: #841028;
	margin: 0 0 0 10px;
	font-size: 12px;
}
</style>
<title>集成管控系统</title>
<link href="Apollo/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="Apollo/themes/icon.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="Apollo/jquery.js"></script>
<script type="text/javascript" src="Apollo/jquery.easyui.js"></script>
<script type="text/javascript" src="Apollo/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="Apollo/jquery.plugin.js"></script>
<script type="text/javascript" src="Apollo/Apollo.js"></script>
<script type="text/javascript" src="Apollo/Apollo.extends.js"></script>
<script type="text/javascript" src="Apollo/md5.js"></script>
<script type="text/javascript" src="Apollo/cookie.mini.js"></script>
<Script Type="Text/Javascript" Src="Apollo/util.js"></Script>
<script type="text/javascript" src="Apollo/prototype.js"></script>
<script type="text/javascript">
        $(function() {
            $('#password').bind('keypress',function(event){
                if(event.keyCode == "13")
                {
                    if($('#userName').val() == ""){
                        $.messager.alert('提示', "请输入用户名", 'info');
                        return false;
                    }
                    if($('#password').val() == ""){
                        $.messager.alert('提示', "请输入密码", 'info');
                        return false;
                    }
                    var args = {
                        'userName':$('#userName').val(),
                        'password':hex_md5($('#password').val())

                    };
//                    GetData('user','prsuser', 'Login', args);
                }
            });


            $('#loginSubmit').click(function(){
                if($('#userName').val() == ""){
                    $.messager.alert('提示', "请输入用户名", 'info');
                    return false;
                }
                if($('#password').val() == ""){
                    $.messager.alert('提示', "请输入密码", 'info');
                    return false;
                }
                var args = {
                    'userName':$('#userName').val(),
                    'password':hex_md5($('#password').val())
                };
                var ajaxParam = {
                    "url":"/login/login.action?",
                    "data":args,
                    "nopage":1
                }

                apolloAjax(ajaxParam,function(retData){
                    if(retData && retData.status =="1"){
                        console.log(retData);
                        miniCookie.setCookie("cookie_user_id",retData.cookie_user_id);
                        miniCookie.setCookie("cookie_user_name",retData.cookie_user_name);
                        miniCookie.setCookie("cookie_user_role_id",retData.cookie_user_role_id);
                        location.href = "/login/welcome.action";
                    }
                },{async:false});

            });
            $('#cancel').click(function(){
                $('#userName').val("");
                $('#password').val("");


            });
        });
        function LoginSuccess(obj) {
            if (obj.result_id == 1) {
                miniCookie.setCookie("cookie_user_id",obj.data.cookie_user_id);
                miniCookie.setCookie("cookie_token",obj.data.cookie_token);
                miniCookie.setCookie("cookie_token_date",obj.data.cookie_token_date);
                miniCookie.setCookie("cookie_user_name",obj.data.cookie_user_name);
                miniCookie.setCookie("cookie_user_role_id",obj.data.cookie_user_role_id);
                miniCookie.setCookie("cookie_user_scope_id",obj.data.cookie_user_scope_id);
                miniCookie.setCookie("cookie_user_ip",obj.data.cookie_user_ip);
                miniCookie.setCookie("cookie_real_name",obj.data.cookie_real_name_enc);
                miniCookie.setCookie("cookie_user_email",obj.data.cookie_user_email);
                miniCookie.setCookie("cookie_user_channel",obj.data.cookie_user_channel);
                var isRex =  /[0-9]+/.test($('#password').val())  &&  /[a-z]+/.test($('#password').val()) && /[A-Z]+/.test($('#password').val());
                if(!isRex){
                    $.messager.alert('系统提示',"您的账号密码不符合规则，账号已被锁定，解锁账号码请电话联系，分机号:9552");
                    return ;
                }

                if(!isRex){
                    $.messager.confirm('系统提示','为了系统安全，密码必须包含数字，大写，小写字母，请登录后及时修改',function(r){
                        if (r){
                            window.location.href = "welcome.html";
                        }else{
                            window.location.href = "welcome.html";
                        }
                    });
                }else{
                    window.location.href = "welcome.html";
                }
            }else{
                $.messager.alert('提示',obj.result_description,'info');
            }
        }
    </script>
</head>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<body>
	<div class="login_page">
		<div class="login_logo"></div>
	</div>
	<div class="login_page">
		<div class="login_cont">
			<div class="login_ctitle">集成登陆平台</div>
			<div class="login_input">
				<div class="tip_error" style="display: block;">
					<span></span>
				</div>
				<div class="login_user">
					<input id="userName" name="userName" type="text" />
				</div>
				<div class="login_pass">
					<input id="password" name="password" type="password" />
				</div>
				<div class="login_button">
					<button class="login_button01" id="loginSubmit"></button>
					<button class="login_button02" id="cancel"></button>
				</div>
			</div>
		</div>
	</div>

</body>
</html>